<!doctype html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link href="../css/mui.min.css" rel="stylesheet" />
	</head>

	<body>
		<header class="mui-bar mui-bar-nav" id="header">	
			<a class="mui-icon mui-icon-back mui-action-back mui-pull-left"></a>
			<h1 class="mui-title ">食药全通</h1>
			<a class="mui-icon mui-icon-search mui-pull-right" id="btnSearch"></a>
		</header>
		<div class="mui-content" id="divContent">
			<!--<div class="mui-input-group" style="margin-top: 10px;">
				<ul class="mui-table-view mui-table-view-striped mui-table-view-condensed">
			        <li class="mui-table-view-cell">
			            <div class="mui-table">
			                <div class="mui-table-cell mui-col-xs-12 mui-navigate-right" style="border: solid red 0px; ">
			                    <h5 class="mui-ellipsis-2" style="padding-top: 5px;">2019年5月份行政处罚案件信息公开</h5>
			                </div>
			            </div>
			        </li>
			        <li class="mui-table-view-cell">
			            <div class="mui-table">
			                <div class="mui-table-cell mui-col-xs-12 mui-navigate-right" style="border: solid red 0px; ">
			                    <h5 class="mui-ellipsis-2" style="padding-top: 5px;">2019年5月份行政处罚案件信息公开</h5>
			                </div>
			            </div>
			        </li>
			   </ul>
			</div>-->
			<div class="mui-input-group" style="margin-top: 10px;">
				<ul class="mui-table-view mui-table-view-striped mui-table-view-condensed" v-for="item in data">
			        <li class="mui-table-view-cell">
			            <div class="mui-table">
			                <div class="mui-table-cell mui-col-xs-12" style="border: solid red 0px; ">
			                	<a class="mui-navigate-right" v-on:tap="openWindow(item)">
			                		<h5 class="mui-ellipsis-2" style="padding-top: 5px;" v-html="item.Title">2019年5月份行政处罚案件信息公开</h5>
			                	</a>
			                </div>
			            </div>
			        </li>
			   </ul>
			</div>
		</div>
		<script src="../js/mui.min.js"></script>
		<script type="text/javascript" src="../js/vue.min.js" ></script>
		<script type="text/javascript" src="../js/app.js?v=20190610" ></script>
		<script type="text/javascript">
			mui.init();
			var vm = new Vue({
				el: '#divContent',
				data: {
					rows:10,
					page:1,
					total:0,
					records:0,
					data: [] //列表信息流数据
				}
			});
			var webview_detail = null; //详情页webview
			mui.plusReady(function(){
				/*app.isImmersed();*/
				 
				var setting = app.getSetting();
				var pagination = {rows:10,page:1};
				var ajaxUrl = setting.ServerUrl +"/api/TrainContent/GetPageList?orderName=Code&orderType=&rows=10&page=1&queryJson=";
				console.log(ajaxUrl);
				plus.nativeUI.showWaiting("正在读取数据，请稍候...");
				mui.ajax(ajaxUrl,{
					dataType:'json',//服务器返回json格式数据
					type:'get',//HTTP请求类型
					timeout:10000,//超时时间设置为10秒；
					headers:{'Content-Type':'application/json'},	              
					success:function(result){
						plus.nativeUI.closeWaiting();
						//服务器返回响应，根据响应结果，分析是否登录成功；
						console.log(JSON.stringify(result));
						if(result.ResultType != 0){
							mui.toast(result.Content);
							return;
						}
						var appendData = JSON.parse(result.AppendData);
						vm.total = appendData.total;
						vm.data = appendData.rows;
						vm.page = appendData.page;
						vm.records = appendData.records;
					},
					error:function(xhr,type,errorThrown){
						plus.nativeUI.closeWaiting();
						//异常处理；
						console.log(type);
						mui.toast("读取数据异常！");
					}
				});
				
				//预加载详情页
				webview_detail = mui.preload({
					id: 'documentInfo',
					url: 'documentInfo.html',
				});
			});
			/**
			 * 打开详情
			 */
//			function openWindow(item){
//				
//				mui.openWindow({
//					id:"documentInfo",
//					url:"documentInfo.html",
//					show:{aniShow: 'pop-in'},
//					extras: {keyValue: item.Id},
//					waiting: {autoShow: true, /*自动显示等待框，默认为true*/}
//				});
//			}
			function openWindow(item) {
				//触发子窗口变更新闻详情
				mui.fire(webview_detail, 'get_detail', {
					Current: item,
				});
//				//更改详情页原生导航条信息
//				titleNView.titleText = item.title;
//				webview_detail.setStyle({
//					"titleNView": titleNView
//				});
				setTimeout(function() {
					webview_detail.show("slide-in-right", 300);
				}, 150);
			}
			
		</script>
	</body>

</html>